It is well known that a performance of an elevator system can be improved by maximizing the number of passengers in each car, and by minimizing round-trip times of the cars.
However, these two goals are at odds with each other. More passengers per car means more stops. This increases the round-trip times.
That is a combinatorial problem, which cannot be solved optimally in a practical time for real-world systems. A further complication is during heavy traffic, cars may not be able to service all assigned passengers in a single round-trip.